<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,
            initial-scale=1.0,user-scalable=0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>页面</title>
    <link rel="stylesheet" href="./static/css/weui.min.css">
    <link rel="stylesheet" href="./static/css/jx.css">
</head>
<body>
<div class="page button js_show">
        <div class="weui-cells__title">挂号信息</div>
        <div class="weui-cells">
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">科室</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" style="color: #757575" type="text" value="神经科" readonly="readonly">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">医生</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" style="color: #757575" type="text" value="王医生" readonly="readonly">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">就诊时间</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" style="color: #757575" type="text" value="2018-03-22 周四 下午"
                           readonly="readonly">
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><label class="weui-label">门诊挂号费</label></div>
                <div class="weui-cell__bd">
                    <input class="weui-input" style="color: #757575" type="text" value="3" readonly="readonly">
                </div>
            </div>
            <div class="weui-cell weui-cell_vcode">
                <div class="weui-cell__hd">
                    <label class="weui-label">就诊人</label>
                </div>
                <div class="weui-cell__bd">
                    <input class="weui-input" id="name" type="text" placeholder="请添加就诊人" readonly="readonly">
                </div>
                <div class="weui-cell__ft">
                    <a class="weui-vcode-btn" id="operate">添加</a>
                </div>
            </div>
        <div class="weui-btn-area">
            <a href="payInfo.html" class="weui-btn weui-btn_primary">确认挂号</a>
        </div>
    </div>
</div>
</body>
<script type="text/html" id="dialog">
    <div class="weui-cells">
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">姓名</label></div>
            <div class="weui-cell__bd">
                <input class="weui-input" id="input-name" type="text" placeholder="请输入姓名">
            </div>
        </div>
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">身份证</label></div>
            <div class="weui-cell__bd">
                <input class="weui-input" type="number" placeholder="请输入身份证号码">
            </div>
        </div>
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">就诊卡号</label></div>
            <div class="weui-cell__bd">
                <input class="weui-input" type="number" placeholder="请输入就诊卡号">
            </div>
        </div>
        <div class="weui-cell">
            <div class="weui-cell__hd"><label class="weui-label">电话</label></div>
            <div class="weui-cell__bd">
                <input class="weui-input" type="tel" placeholder="请输入电话或手机号码">
            </div>
        </div>
    </div>
</script>
<script type="text/javascript" src="./static/js/weui.min.js"></script>
<script type="text/javascript" src="./static/js/zepto.min.js"></script>
<script type="text/javascript">
    $(function(){
        var operateText = $('#name').val() ? '修改' : '添加';
        $('#operate').html(operateText);
        $('#operate').on('click', function(){
            weui.dialog({
                title: '请输入就诊人信息',
                content: $("#dialog").html(),
                className: 'dialog-form',
                buttons: [{
                    label: '取消',
                    type: 'default',
                    onClick: function () {
                        weui.alert('取消');
                    }
                }, {
                    label: '确定',
                    type: 'primary',
                    onClick: function () {
                        $('#name').val($('#input-name').val());
                        var operateText = $('#input-name').val() ? '修改' : '添加';
                        $('#operate').html(operateText);
                    }
                }]
            });
        });
    });
    weui.topTips("你已经挂过了,FUCK!!");
</script>
</html>
